package com.feedback.c;

import android.content.Context;
import android.content.Intent;
import com.feedback.b.b;
import com.feedback.b.c;
import com.feedback.b.d;
import java.util.concurrent.Callable;
import org.json.JSONObject;

public class c
  implements Callable
{
  static String a = "MsgWorker";
  JSONObject b;
  Context c;

  public c(JSONObject paramJSONObject, Context paramContext)
  {
    this.b = paramJSONObject;
    this.c = paramContext;
  }

  public Boolean a()
  {
    String str3;
    String str4;
    String str5;
    JSONObject localJSONObject1;
    Intent localIntent;
    String str1 = this.b.optString("type");
    String str2 = this.b.optString("feedback_id");
    if ("user_reply".equals(str1))
    {
      str3 = "http://feedback.whalecloud.com/feedback/reply";
      str4 = "user_reply";
      str5 = "reply";
    }
    try
    {
      String str6 = d.a(str3, str5, this.b);
      if (str6 != null)
      {
        JSONObject localJSONObject2 = new JSONObject(str6);
        localJSONObject1 = localJSONObject2;
        localIntent = new Intent().setAction("postFeedbackFinished").putExtra("type", str4).putExtra("feedback_id", str2);
        if (!(b.a(localJSONObject1)))
          break label184;
        b.e(this.b);
        localIntent.putExtra("PostFeedbackBroadcast", "succeed");
        if (!("user_reply".equals(str1)))
          break label205;
        com.feedback.b.c.b(this.c, this.b);
        this.c.sendBroadcast(localIntent);
        return null;
        str3 = "http://feedback.whalecloud.com/feedback/feedbacks";
        str4 = "new_feedback";
        label184: label205: str5 = "feedback";
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            localException.printStackTrace();
            localJSONObject1 = null;
          }
          b.c(this.b);
          localIntent.putExtra("PostFeedbackBroadcast", "fail");
        }
        com.feedback.b.c.a(this.c, "feedback", str2);
        com.feedback.b.c.a(this.c, this.b);
      }
    }
  }
}